Ext.ux.GridActionMenu = function(a) {
    var grid, menu, actions;
    this.init = function(gp) {
        grid = gp;
        actions = a;
        grid.on('rowcontextmenu', onRowContextMenu);
    }

    function onRowContextMenu(g, r, e) {
        grid.getSelectionModel().selectRow(r);
        if (!menu) {
            menu = new Ext.menu.Menu(actions);
        }
        e.preventDefault();
        menu.showAt(e.getPoint());
    }
};